<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
		<meta name="renderer" content="webkit">
		<!--国产浏览器高速模式-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="网站简介" />
		<!-- 网站简介 -->
		<meta name="keywords" content="搜索关键字，以半角英文逗号隔开" />
		<title>温度编辑</title>
		
		<!-- 公共样式 开始 -->
		<link rel="stylesheet" type="text/css" href="../../css/base.css">
		<link rel="stylesheet" type="text/css" href="../../css/iconfont.css">
		<script type="text/javascript" src="../../framework/jquery-1.11.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
		<script type="text/javascript" src="../../layui/layui.js"></script>
		<!-- 滚动条插件 -->
		<link rel="stylesheet" type="text/css" href="../../css/jquery.mCustomScrollbar.css">
		<script src="../../framework/jquery-ui-1.10.4.min.js"></script>
		<script src="../../framework/jquery.mousewheel.min.js"></script>
		<script src="../../framework/jquery.mCustomScrollbar.min.js"></script>
		<script src="../../framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
		<!-- 公共样式 结束 -->
	</head>

	<body>
		<div class="">
					<form id="addForm" class="layui-form" action="">
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">温度</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="Rolename" id="Rolename" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">最高温度</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="description" id="description" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">最低温度</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="deepth" id="deepth" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">创建时间</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="parentid" id="parentid" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">任务编号</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="parentid" id="parentid" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label" style="width:100px;">备注</label>
						<div class="layui-input-inline shortInput">
							<input type="text" name="parentid" id="parentid" required lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<button class="layui-btn" lay-submit lay-filter="submitBut" id="btn_addroler">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</form>	
				</div>
				<script type="text/javascript">
		 layui.use(['table','jquery','form','layer'], function(){
		  var table = layui.table;
		  var $ = layui.jquery;
		  var form=layui.form;
		  var layer = layui.layer;
		  
		    //监听提交,添加事件
		    form.on('submit(btn_update)', function(data){
		      var field = data.field; //获取提交的字段
		      var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引  
					var Roleid=$("#Roleid").val().trim();
					var Rolename=$("#Rolename").val().trim();
			    	var description=$("#description").val();
					var createtime=$("#createtime").val();
					var deepth=$("#deepth").val();
					var parentid=$("#parentid").val();
					 var param ="?Roleid="+Roleid+ "&Rolename=" + Rolename + "&description=" +description + "&createtime=" +createtime + "&deepth=" +deepth + "&parentid=" +parentid;
				    //alert(param)
					$.ajax({
						url:'role/modifyrole' + param,
						type:"POST",
						data:null,
						dataType : "json",
						xhrFields :{
							withCredentials: true
						},
						contentType:'application/json;charset=UTF-8',
						success:function(e){
							//alert(e.msg)
							if(e.code == 10001){
								layer.msg(e.msg,{icon:6}); 
							}else{
								layer.msg(e.msg,{icon:5});
							}
							
							setTimeout(function(){
								parent.layui.table.reload('LAY-app-content-list'); //重载表格
		     					parent.layer.close(index); //再执行关闭 
								parent.layui.table.reload('Rolemodel'); //重载表格
							},1*1000)
						},
						error:function(e){
							layer.msg(e.msg,{icon:5});
						}
					})
		      	return false;
		    });
		});
		</script>
	</body>

</html>
